package com.example.demo;

import com.example.demo.model.MyList;
import com.example.demo.model.Student;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2023-02-15
 * Time: 19:16
 */
@RestController
public class TestController {

//    @Value("${UserName.name}")
//    private String name;

    @Value("${myString}")
    private String myString;

    @Value("${mykey.str1}")
    private String str1;

    @Value("${mykey.str2}")
    private String str2;

    @Value("${mykey.str3}")
    private String str3;

<<<<<<< Updated upstream
    @Autowired
    private Student student;

    @Autowired
    private MyList myList;

    //创建日志对象
    Logger log = LoggerFactory.getLogger(TestController.class);

    @RequestMapping("/hi")
    public String sayHi() {
        log.trace("Hi,i am trace");
        log.debug("Hi,i am debug");
        log.info("Hi,i am info");
        log.warn("Hi,i am warn");
        log.error("Hi,i am error");
//        System.out.println(str1);
//        System.out.println();
//        System.out.println(str2);
//        System.out.println();
//        System.out.println(str3);
//        System.out.println();

        return "hi " + "List的元素个数是:" + myList.getDbtype().size() + " | List的第一个元素是:" + myList.getDbtype().get(0) +
                student.getName() + " " + student.getAge();
=======
    @RequestMapping("/hi")
    public String sayHi() {
        System.out.println(str1);
        System.out.println();
        System.out.println(str2);
        System.out.println();
        System.out.println(str3);
        System.out.println();
        return "hi" + myString;
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
    }
}
